<?php
require_once 'Datatype_double.php';


/**
 * Datatype for currency
 * 
 * @package EDO
 * @subpackage Datatypes
 *
 */
class Datatype_currency extends Datatype_double 
{
	protected $_SQLValueIsQuoted = false;
	
	function validate($validate)
	{
		$validate = str_ireplace(".", '', $validate);
		$validate = str_ireplace(",", '.', $validate);
				
		if(($validate = parent::validate($validate)) !== false)
			return $validate;
		
		return false;
	}
	
	public function getDisplayValue()
	{
		return number_format($this->getValue(), 2, ',', '.');
	}
	
	
	
}